package edu.wust;

public class exam46 {
    public static boolean isPrime(int num){
        if(num<2)
            return false;
        if(num==2)
            return true;
        int n=(int)Math.sqrt(num);
        for(int i=2;i<=n;++i){
            if(num%i==0)
                return false;
        }
        return true;
    }
    public static int doublesqr(int num){
        return 2*num*num;
    }
    public static void main(String[] args) {
        for(int i=33;;i+=2){//5777
            int judge=0;
            if(!isPrime(i)){
                judge=2;
                int temp=i;
                int j=1;
                int latter=doublesqr(j);
                while(latter<temp){
                    int former=temp-latter;
                    if(isPrime(former)){
                        judge=1;
                        break;
                    }
                    j++;
                    latter=doublesqr(j);
                }
            }
            if(judge==2){
                System.out.println(i);
                break;
            }
        }
    }
}

